The TUnitRequest Structure
You use theTUnitRequest
structure to specify information about the data being sent with theOTSndURequest
function (page 3-107) and the data being read with theOTRcvURequest
function (page 3-110); you pass a pointer to this structure as a parameter to each of these functions.The
TUnitRequest
structure is defined by theTUnitRequest
data type.
struct TUnitRequest { TNetbuf addr; TNetbuf opt; TNetbuf udata; OTSequence sequence; }; typedef struct TUnitRequest TUnitRequest;
Field Description
addr
- A
TNetbuf
structure that contains information about an address.- In the
req
parameter to theOTSndURequest
function, this field specifies the location and size of a buffer containing the address of the responder. You must allocate a buffer for the address and specify the address. You must set theaddr.buf
field to point to this buffer and set theaddr.len
field to the length of the address.- In the
req
parameter to theOTRcvURequest
function, this field specifies the location and size of a buffer containing the address of the endpoint that made the request; the field is filled in by theOTRcvURequest
function when it returns. You must allocate a buffer to hold address information and set theaddr.bu
f field to point to it. You must also set theaddr.maxlen
field to the maximum size of the address.opt
- A
TNetbuf
structure that contains information about the options associated with this request.- In the
req
parameter to theOTSndURequest
function, this field specifies the location and size of a buffer containing the options you want to negotiate. You must allocate a buffer that contains the option information and set theopt.buf
field to point to it. You must set theopt.len
field to the length of the option data or to 0 if you don't want to specify any options.- In the
req
parameter to theOTRcvURequest
function, this field specifies the location and size of a buffer containing the association-related options specified by the requester. Otherwise, this buffer is empty. When theOTRcvURequest
function returns, it places option information in this buffer. You must allocate a buffer to contain the option information and set theopt.buf
field to point to this buffer. You must set theopt.maxlen
field to the maximum size necessary to hold option information for the endpoint.udata
- A
TNetbuf
structure that contains information about the request data.- In the
req
parameter to theOTSndURequest
function, this field specifies the location and size of a buffer containing the request data. You must allocate a buffer for the request data, initialize theudata.buf
field to point to it, and set theudata.len
field to the size of the request. The request size must not exceed the value for theetsdu
field of theTEndpointInfo
structure for the endpoint.- If you are sending data that is not stored contiguously, the
udata.buf
field is a pointer to anOTData
structure that describes the first data fragment. In this case, you must set theudata.len
field to thekNetbufDataIsOTData
constant.- In the
req
parameter to theOTRcvURequest
function, this field specifies the location and size of a buffer containing the request. You must allocate a buffer into which theOTRcvURequest
function can place the request and set theudata.buf
field to point to it. You must set theudata.maxlen
field to the maximum size of the request data.- If you are doing a no-copy receive, the
udata.buf
field is a pointer to anOTBuffer
pointer. In this case, you must set theudata.maxlen
field to the constantkNetbufDataIsOTBufferStar
.sequence
- A long that specifies the transaction ID for this transaction.
- You set this field to any desired value when you send
the request.- When you read the request, this value is generated by the endpoint provider. You need to save this value and use it for the
sequence
field when sending a reply.